package cc.vv.btpartyjob.partyservice.delegate

import android.widget.TextView
import cc.vv.baselibrary.view.BaseTopBarView
import cc.vv.btpartyjob.partyservice.R
import cc.vv.mvp.delegate.BaseAppDelegate

/**
 * 发布微心愿托管类
 * Created by Chen.qi on 2018/10/27.
 */
class SubmitTinyWishActivityDelegate : BaseAppDelegate() {

    override fun initWidget() {

    }

    override fun initLayoutRes(): Int {
        return R.layout.activity_submit_tiny_wish
    }

    /**设置标题title*/
    fun setTopBarTitle(topBarTitle: String) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_astW_topBar)
        titleBar?.setTitle(topBarTitle)
    }


    /**设置标题右边按钮点击事件*/
    fun setTitleBackBtnOnClick(event: BaseTopBarView.EventInterface) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_astW_topBar)
        titleBar?.setEventInterface(event)
    }

    /**
     * 获取name
     */
    fun getName(): String {
        val viewName = getView<TextView>(R.id.et_astW_inputName)
        return viewName?.text.toString().trim()
    }

    /**
     * 获取电话
     */
    fun getMobile(): String {
        val viewMobile = getView<TextView>(R.id.et_astW_inputTelPhone)
        return viewMobile?.text.toString().trim()
    }

    /**
     * 获取地址
     */
    fun getAddress(): String {
        val viewTitle = getView<TextView>(R.id.et_astW_inputAddress)
        return viewTitle?.text.toString().trim()
    }

    /**
     * 获取内容
     */
    fun getContent(): String {
        val viewContent = getView<TextView>(R.id.et_astW_inputContent)
        return viewContent?.text.toString().trim()
    }

    /**
     * 设置起始时间
     */
    fun setStartTime(startTime: String) {
        val tvStartTime = getView<TextView>(R.id.tv_astW_startTime)
        tvStartTime?.text = startTime
    }

    /**
     * 设置结束时间
     */
    fun setEndTime(startTime: String) {
        val tvEndTime = getView<TextView>(R.id.tv_astW_endTime)
        tvEndTime?.text = startTime
    }

}